Yacon.component.TSqlGridTitle = function(element){
	this.element = element;
	
	this.name = element.name;
	this.ico = element.ico;
	this.menu = new Yacon.widget.TMenu(element.menu);
	
};

Yacon.component.TSqlGridTitle.prototype = {
	
	/* 获取HTML信息 */	
	getHtml: function(){
		
		var html = "";
		
		html += "<div class='panel-heading bk-bg-primary row-ht-fix lily-table-title'>";
		
		html += this.getTitleHtml();
		
		html += '</div>';
		
		return html;
		
	},
	
	/* 获取标题HTML信息 */
	getTitleHtml: function(){
		
		var html = "";
		
		html += "<h5><span class='"+this.ico+"'></span><span class='break'>&nbsp;&nbsp;</span>"+this.name+"</h5>";	
		
		if(Yacon.isEmpty(this.parent.view.grid.topbtn)){
			html += this.menu.getTopHtml();
		}else if(this.parent.view.grid.topbtn == "ico"){
			html += this.menu.getTopHtml();
		}else if(this.parent.view.grid.topbtn == "all"){
			html += this.menu.getBottomHtml();
		}else {
			html += this.menu.getTopHtml();
		}
		
		return html;
		
	}
	
};